using SqlSugar;


namespace LuUpgrade.Model
{
    [SugarTable("servers")]
    public abstract class ServerEntity
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        [SugarColumn(ColumnName = "client_ver")]
        public string? ClientVer { get; set; }

        [SugarColumn(ColumnName = "name")] public string? Name { get; set; }

        [SugarColumn(ColumnName = "alias")] public string? Alias { get; set; }

        [SugarColumn(ColumnName = "game_addr")]
        public string? GameAddr { get; set; }

        [SugarColumn(ColumnName = "game_port")]
        public int GamePort { get; set; }

        [SugarColumn(ColumnName = "log_db_config")]
        public string? LogDbConfig { get; set; }

        [SugarColumn(ColumnName = "report_url")]
        public string? ReportUrl { get; set; }

        [SugarColumn(ColumnName = "status")] public int Status { get; set; }

        [SugarColumn(ColumnName = "create_time", IsNullable = true)]
        public DateTime? CreateTime { get; set; }

        [SugarColumn(ColumnName = "require_ver")]
        public int RequireVer { get; set; }

        [SugarColumn(ColumnName = "remark")] public string? Remark { get; set; }

        [SugarColumn(ColumnName = "json_data")]
        public string? JsonData { get; set; }

        [SugarColumn(ColumnName = "order")] public int Order { get; set; }
        [SugarColumn(ColumnName = "commend")] public int Commend { get; set; }
        [SugarColumn(ColumnName = "is_ios")] public int IsIos { get; set; }

        [SugarColumn(ColumnName = "last_time", IsNullable = true)]
        public DateTime? LastTime { get; set; }

        [SugarColumn(ColumnName = "tabId", IsNullable = true)]
        public int? TabId { get; set; }

        [SugarColumn(ColumnName = "game_data", IsNullable = true)]
        public string? GameData { get; set; }

        [SugarColumn(ColumnName = "battleplan_id", IsNullable = true)]
        public int? BattlePlanId { get; set; }

        [SugarColumn(ColumnName = "real_number", IsNullable = true)]
        public int? RealNumber { get; set; }

        [SugarColumn(ColumnName = "expect_number", IsNullable = true)]
        public int? ExpectNumber { get; set; }

        [SugarColumn(ColumnName = "expect_time", IsNullable = true)]
        public int? ExpectTime { get; set; }

        [SugarColumn(ColumnName = "switch_status", IsNullable = true)]
        public int? SwitchStatus { get; set; }

        [SugarColumn(ColumnName = "open_server_status", IsNullable = true)]
        public int? OpenServerStatus { get; set; }

        [SugarColumn(ColumnName = "bitflag", IsNullable = true)]
        public uint Bitflag { get; set; }

        [SugarColumn(ColumnName = "season_group_id", IsNullable = true)]
        public uint SeasonGroupId { get; set; }

        [SugarColumn(ColumnName = "mluid", IsNullable = true)]
        public uint MluId { get; set; }

        [SugarColumn(ColumnName = "lm_list", ColumnDataType = "text", IsNullable = true)]
        public string? LmList { get; set; }

        [SugarColumn(ColumnName = "su_id", IsNullable = true)]
        public uint SuId { get; set; }

        [SugarColumn(ColumnName = "open_time", IsNullable = true)]
        public DateTime? OpenTime { get; set; }
    }


    [SugarTable("groups")]
    public class GroupEntity
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "id")]
        public int Id { get; set; }

        [SugarColumn(ColumnName = "group_key")]
        public string? GroupKey { get; set; }

        [SugarColumn(ColumnName = "name", IsNullable = false)]
        public string? Name { get; set; }

        [SugarColumn(ColumnName = "login_url")]
        public string? LoginUrl { get; set; }

        [SugarColumn(ColumnName = "card_url")] public string? CardUrl { get; set; }

        [SugarColumn(ColumnName = "notice_url", IsNullable = false)]
        public string? NoticeUrl { get; set; }

        [SugarColumn(ColumnName = "cdn_url")] public string? CdnUrl { get; set; }

        [SugarColumn(ColumnName = "notice_select", IsNullable = false)]
        public int NoticeSelect { get; set; }

        [SugarColumn(ColumnName = "remark", IsNullable = false)]
        public string? Remark { get; set; }

        [SugarColumn(ColumnName = "other")] public string? Other { get; set; }

        [SugarColumn(ColumnName = "pid_list", IsNullable = false)]
        public string? PidList { get; set; }

        [SugarColumn(ColumnName = "version")] public int Version { get; set; }

        [SugarColumn(ColumnName = "custom_url")]
        public string? CustomUrl { get; set; }

        [SugarColumn(ColumnName = "sdk_url")] public string? SdkUrl { get; set; }

        [SugarColumn(ColumnName = "audit_version")]
        public int AuditVersion { get; set; }

        [SugarColumn(ColumnName = "audit_server")]
        public int AuditServer { get; set; }

        [SugarColumn(ColumnName = "last_time")]
        public DateTime? LastTime { get; set; }

        [SugarColumn(ColumnName = "resource_version")]
        public int ResourceVersion { get; set; }

        [SugarColumn(ColumnName = "audit_servers")]
        public string? AuditServers { get; set; }

        [SugarColumn(ColumnName = "audit_versions")]
        public string? AuditVersions { get; set; }

        [SugarColumn(ColumnName = "game_app_key")]
        public string? GameAppKey { get; set; }

        [SugarColumn(ColumnName = "expect_number", IsNullable = true, DefaultValue = "0")]
        public int ExpectNumber { get; set; }

        [SugarColumn(ColumnName = "expect_time", IsNullable = true, DefaultValue = "0")]
        public int ExpectTime { get; set; }

        [SugarColumn(ColumnName = "switch_status", IsNullable = true, DefaultValue = "0")]
        public int SwitchStatus { get; set; }

        [SugarColumn(ColumnName = "switch_last_time")]
        public DateTime? SwitchLastTime { get; set; }

        [SugarColumn(ColumnName = "is_display", IsNullable = true, DefaultValue = "0")]
        public short IsDisplay { get; set; }

        [SugarColumn(ColumnName = "create_time", IsNullable = true, DefaultValue = "CURRENT_TIMESTAMP")]
        public DateTime? CreateTime { get; set; }
    }


    [SugarTable("channel")]
    public class ChannelEntity
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        public string? ChannelKey { get; set; }

        [SugarColumn(ColumnName = "login_key")]
        public string? LoginKey { get; set; }

        public string? Name { get; set; }

        public string? Username { get; set; }

        public string? Password { get; set; }

        [SugarColumn(ColumnName = "create_time")]
        public DateTime? CreateTime { get; set; }

        [SugarColumn(ColumnName = "last_time")]
        public DateTime? LastTime { get; set; }

        [SugarColumn(ColumnName = "last_ip")] public string? LastIp { get; set; }

        public int Logins { get; set; }

        [SugarColumn(ColumnName = "agent_name")]
        public string? AgentName { get; set; }

        [SugarColumn(ColumnName = "game_app_key")]
        public string? GameAppKey { get; set; }

        [SugarColumn(ColumnName = "group_key")]
        public string? GroupKey { get; set; }

        [SugarColumn(ColumnName = "allow_earn")]
        public int AllowEarn { get; set; }

        [SugarColumn(ColumnName = "back_rate")]
        public int BackRate { get; set; }

        [SugarColumn(ColumnName = "neimax_charge")]
        public int NeimaxCharge { get; set; }

        [SugarColumn(ColumnName = "neimax_resource")]
        public int NeimaxResource { get; set; }

        [SugarColumn(ColumnName = "nologin_day")]
        public int NoLoginDay { get; set; }

        [SugarColumn(ColumnName = "init_val")] public int InitVal { get; set; }

        public int Whitelist { get; set; }

        [SugarColumn(ColumnName = "group_name")]
        public string? GroupName { get; set; }

        [SugarColumn(ColumnName = "group_id")] public int GroupId { get; set; }
    }
}